package com.as3this.ui
{
	import com.as3this.core.ServiceIcon;
	
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	
	public class IconMenu extends BaseSharingMenu
	{
		public function IconMenu(canvas:Sprite, destinations:Array, shareBtn:DisplayObject = null)
		{
			super(canvas, destinations, shareBtn);
		}
		
		override public function createDisplay(destinations:Array) : void
		{
			var iconX:int = 5;
			
			for (var i:uint = 0; i < destinations.length; i++)
			{
				// create display object that will be used to click through - let's just use an icon!
				var icon	:ServiceIcon = new ServiceIcon(iconX, 5, destinations[i]);
				var item	:BaseMenuItem = new BaseMenuItem(iconX, 5, destinations[i], icon);
				container.addChild(item);
				
				iconX += 20;
			}
			
			container.graphics.beginFill(0xFFFFFF, 1);
			container.graphics.drawRoundRect(0, 0, iconX + 10, ServiceIcon.DEFAULT_SIZE + 10, 10);
		}

	}
}